<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<title>上善云图</title>

	<div>
		<c:if test="${systemEntiy.roleId != 3}">
			<a href="#" class="easyui-linkbutton" onclick="msg.toolbar.showAddDialog();" data-options="
			iconCls:'icon-add',
			">
				发送消息  
			</a>
			<a href="#" class="easyui-linkbutton" onclick="show()" data-options="iconCls:'icon-search'">查看站内消息</a>
		</c:if>
	</div>
	<div id="studentGrid">
</div>


<div id="msgAddMsg" class="easyui-dialog msg-add" style="width:350px" data-options="
title: '新增站内消息',
buttons: '#msgAddMsgButtons',
closed: true
"><!-- onClose: msg.toolbar.resetUpdateFrom -->
	<form id="msgAddForm" style="text-align: center" method="post">
		<input type="hidden" name="id"/>
		<p>
			<strong>标　　题：</strong>
			<input type="text" name="title" id = "title" class="easyui-validatebox" data-options="required:true">
		</p>
		<p>
			<strong>内　　容：</strong>
			<input name="content" class="easyui-textbox" id = "content" data-options="multiline:true,required:true" style="width:178px;height:100px" >
		</p>
		<p>
			<strong>过期时间：</strong>
			<input  name="expireTime" id = "expireTime" class="easyui-datetimebox" data-options="
			value:'1/1/2015 23:59:59'" >
		</p>
		
		
		<p>
			<strong>接收人员：</strong>
			<input name="receiveMan" id = "receiveMan" class="easyui-combobox"  
			data-options="
					url:'<%=request.getContextPath()%>/AssistMsgServlet?command=listPerson',
					method:'post',
					valueField:'name',
					textField:'name',
					required:true,
					multiple:true,
					editable:false,
					panelHeight:'auto',
				">
		</p>
		<p>
			<strong>状　　态：</strong>
			<select class="easyui-combobox" name="state" data-options="
					panelHeight:'auto',
					width:172,
					required:true
				">
				<option value="1">启用 </option>
				<option value="2">待启用</option>
			</select>
		</p>
	</form>
</div>
<div id="msgAddMsgButtons" style="text-align: center">
	<a href="#" onclick="msg.btn.sureAddMsg();" class="easyui-linkbutton" data-options="
	iconCls: 'icon-edit',
	plain: true">
		确认新增
	</a>
	<a href="#" onclick="msg.btn.hiddenAddMsgDialog();" class="easyui-linkbutton" data-options="
	iconCls: 'icon-cancel',
	plain: true">
		取消
	</a>
</div>

<script>
window.ctx = "<%=request.getContextPath() %>"
</script>
<script type = "text/javascript">
function show(){
	$.post(window.ctx + '/StudentServlet?command=StuMessage','${systemEntiy.id }',function(data){
		if(data){
			var d = data[data.length-1].content;
			var t = data[data.length-1].title;
			$.messager.show({
				title: t,
				msg:d,
				timeout: 3000,
				showType: 'slide'
			});
		}
	},'json')
}
</script>
<script src="<%=request.getContextPath()%>/static/student/js/student.js"></script>
<script src="<%=request.getContextPath()%>/static/common/msg.js"></script>